/*
 * Copyright 2013 Nicholas Bilyk
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package jasper.model.elements;

/**
 * The attribute element defines an attribute.
 *
 * Parent elements: attributeGroup, schema, complexType, restriction (both simpleContent and complexContent),
 * extension (both simpleContent and complexContent)
 *
 * Source: http://www.w3schools.com/schema/el_attribute.asp
 *
 * @author nbilyk
 */
public class Attribute extends SchemaNode {

	/**
	 * Optional. Specifies a default value for the attribute. Default and fixed attributes cannot both be present.
	 */
	public String _default;

	/**
	 * Optional. Specifies a fixed value for the attribute. Default and fixed attributes cannot both be present.
	 */
	public String fixed;

	/**
	 * Optional. Specifies the form for the attribute. The default value is the value of the attributeFormDefault
	 * attribute of the element containing the attribute. Can be set to one of the following:
	 * qualified - indicates that this attribute must be qualified with the namespace prefix and the no-colon-name
	 * (NCName) of the attribute.
	 * unqualified - indicates that this attribute is not required to be qualified with the namespace prefix and is
	 * matched against the (NCName) of the attribute.
	 */
	public AttributeForm form;

	/**
	 * Optional. Specifies a unique ID for the element.
	 */
	public String id;

	/**
	 * Optional. Specifies the name of the attribute. Name and ref attributes cannot both be present.
	 */
	public String name;

	/**
	 * Optional. Specifies a reference to a named attribute. Name and ref attributes cannot both be present. If ref
	 * is present, simpleType element, form, and type cannot be present.
	 */
	public String ref;

	/**
	 * Optional. Specifies a built-in data type or a simple type. The type attribute can only be present when the
	 * content does not contain a simpleType element.
	 */
	public IAttributeType type;

	/**
	 * Optional. Specifies how the attribute is used. Can be one of the following values:
	 * optional - the attribute is optional (this is default).
	 * prohibited - the attribute cannot be used.
	 * required - the attribute is required.
	 */
	public AttributeUse use;
}